<%--
  Created by IntelliJ IDEA.
  User: HolyFox
  Date: 2022/11/30
  Time: 10:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css"/>
</head>
<body>

<div class = "header">
    <img src ="${pageContext.request.contextPath}/img/homelogo.png">
    <button>主页</button>
    <button>不知道起啥</button>
</div>
<div class = "header2">
    <div class="main">
        <h3 class="login_title">用户登录</h3>
        <form action="" method="get" href="" name = "account">
            <ul>
                <li>
                    <h3>304宿舍账号登录</h3>
                </li>
                <li>
                    <label>账号：</label><input type="text"  id="customerName" class="customerIpt"  placeholder="国内手机号/用户名/邮箱/卡号"/>
                </li>
                <li>
                    <label>密码：</label><input type="password"  id="customerPwd" class="customerIpt" placeholder="登录密码"/>
                </li>
                <li>
                    <input  type="submit" value="登录" class="loginBtn"  onclick="checkuser1()" />

                </li>
            </ul>
            <label class = "agreement">
                <input type="checkbox" checked="checked">记住密码
            </label>
            <h4>使用第三方软件登录：</h4>
            <div class="login-other">
                <a href="" title="支付宝登录" class="icon-alipay" >支付宝</a>
                <a href="" title="QQ登录" class="icon-qq" >QQ</a>
                <a href="" title="百度登录" class="icon-baidu" >百度</a>
                <a href="" title="新浪微博登录" class="icon-sina" >新浪微博</a>
                <a href="" title="微信登录" class="icon-wechat" >微信</a>
            </div>
            <div class="forgetpaw">
                <a href = "" title="忘记密码？找回密码">忘记密码？找回密码</a>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">

    function getValue(id) {
        return document.getElementById(id).value;
    }
    function checkuser1() {

        if(getValue('customerName') == "535710149" && getValue('customerPwd') == "111111") {
            account.action='${pageContext.request.contextPath}/customer/1';
            account.action.submit();

        }else if(getValue('customerName') == "535710149@qq.com" && getValue('customerPwd') == "123"){
            account.action='${pageContext.request.contextPath}/customer/2';
            account.action.submit();
        }else {
            alert("登录名或密码错误！")
            return false;
        }
    }

</script>
</html>